package com.jingyuan.biz;

import com.jingyuan.biz.server.NettyHarmonyServer;
import com.jingyuan.common.entity.utils.SpringUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

@SpringBootApplication
public class ServerTest implements CommandLineRunner {
    @Autowired
    private NettyHarmonyServer server;
    public static void main(String[] args) throws InterruptedException {
        SpringApplication.run(ServerTest.class);

    }

    @Override
    public void run(String... args) throws Exception {
        //NettyHarmonyServer netttHarmonyServer=new NettyHarmonyServer();
        server.setPort(9898);
        server.start();
    }

    @Bean
    public SpringUtil getSpringUtil(){
        return new SpringUtil();
    }
}
